STEP 9: First we'll make it so that the loop ends if the dragon has revealed all of the letters in the word. We'll do that by testing if the length of revealed_letters is equal to the length of word.

len() is how we get the length of a string in Python.

  • Go to and drag out Length. Change the name of the variable to revealed_length.
  • Change the variable parameter in len() to revealed_letters.


To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)